package com.appwoo.txtws.service;

import android.content.Context;
import android.util.Xml;
import com.appwoo.android.exception.NotFoundNetWorkException;
import com.appwoo.android.exception.TimeOutException;
import com.appwoo.android.util.PullIO;
import com.appwoo.txtws.bean.SeniorListBean;
import com.appwoo.txtws.bean.StateBean;
import com.appwoo.txtws.component.GetDateTime;
import com.appwoo.txtws.component.Logger;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class LimitTimeService
{
  public StateBean conmitTime(String paramString1, String paramString2, SeniorListBean paramSeniorListBean, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    StateBean localStateBean = new StateBean();
    String str = new MsgService().sendMessage(paramString1, new StringBuilder(String.valueOf(new StringBuilder("<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>").append(paramString1).append("</SNDR>").append("<TYPE>ADPeriod</TYPE></HEAD><BODY><BID>").append(paramString2).append("</BID>").toString())).append("<List><Week>").append(paramSeniorListBean.getWeek()).append("</Week><STTM>").append(paramSeniorListBean.getStartime()).append("</STTM><EDTM>").append(paramSeniorListBean.getEndtime()).append("</EDTM></List>").toString() + "</BODY></MSG>", paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localStateBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localStateBean = new StateBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localStateBean.setCode(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localStateBean.setDesc(((XmlPullParser)localObject).nextText());
    }
  }

  public StateBean conmitTime(String paramString1, String paramString2, List<SeniorListBean> paramList, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    StateBean localStateBean = new StateBean();
    MsgService localMsgService = new MsgService();
    String str1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR>" + "<TYPE>ADPeriod</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID>";
    int i = -1 + paramList.size();
    Object localObject;
    int j;
    while (true)
    {
      String str2;
      if (i < 0)
      {
        str2 = localMsgService.sendMessage(paramString1, str1 + "</BODY></MSG>", paramContext);
        localObject = Xml.newPullParser();
      }
      try
      {
        XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
        localObject = localXmlPullParser;
        j = ((XmlPullParser)localObject).getEventType();
        if (j == 1)
        {
          return localStateBean;
          SeniorListBean localSeniorListBean = (SeniorListBean)paramList.get(i);
          if (localSeniorListBean.getUpdated())
            str1 = str1 + "<List><Week>" + localSeniorListBean.getWeek() + "</Week><STTM>" + localSeniorListBean.getStartime() + "</STTM><EDTM>" + localSeniorListBean.getEndtime() + "</EDTM></List>";
          i--;
        }
      }
      catch (NullPointerException localNullPointerException)
      {
        while (true)
          localNullPointerException.printStackTrace();
        switch (j)
        {
        case 1:
        default:
        case 0:
        case 2:
        }
      }
    }
    while (true)
    {
      j = ((XmlPullParser)localObject).next();
      break;
      localStateBean = new StateBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localStateBean.setCode(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localStateBean.setDesc(((XmlPullParser)localObject).nextText());
    }
  }

  public StateBean delCommit(String paramString1, String paramString2, List<SeniorListBean> paramList, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    StateBean localStateBean = null;
    MsgService localMsgService = new MsgService();
    String str1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR>" + "<TYPE>DLPeriod</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID>";
    Iterator localIterator = paramList.iterator();
    Object localObject;
    int i;
    while (true)
    {
      String str2;
      if (!localIterator.hasNext())
      {
        str2 = localMsgService.sendMessage(paramString1, str1 + "</BODY></MSG>", paramContext);
        localObject = Xml.newPullParser();
      }
      try
      {
        XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
        localObject = localXmlPullParser;
        i = ((XmlPullParser)localObject).getEventType();
        if (i == 1)
        {
          return localStateBean;
          SeniorListBean localSeniorListBean = (SeniorListBean)localIterator.next();
          str1 = str1 + "<List><Week>" + localSeniorListBean.getWeek() + "</Week><STTM>" + localSeniorListBean.getStartime() + "</STTM><EDTM>" + localSeniorListBean.getEndtime() + "</EDTM></List>";
        }
      }
      catch (NullPointerException localNullPointerException)
      {
        while (true)
          localNullPointerException.printStackTrace();
        switch (i)
        {
        case 1:
        default:
        case 0:
        case 2:
        }
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localStateBean = new StateBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localStateBean.setCode(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localStateBean.setDesc(((XmlPullParser)localObject).nextText());
    }
  }

  public StateBean delLimitTime(String paramString1, String paramString2, String paramString3, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    StateBean localStateBean = new StateBean();
    String str = new MsgService().sendMessage(paramString1, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR>" + "<TYPE>DLCmd</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID><STTM>" + paramString3 + "</STTM><Type>0</Type></BODY></MSG>", paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localStateBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localStateBean = new StateBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localStateBean.setCode(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localStateBean.setDesc(((XmlPullParser)localObject).nextText());
    }
  }

  public String getSoftLimitTime(String paramString1, String paramString2, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    String str1 = "";
    MsgService localMsgService = new MsgService();
    String str2 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR><RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>RQGamePeriod</TYPE></HEAD><BODY><UserID>" + paramString2 + "</UserID></BODY></MSG>";
    Logger.i("TXTW", "msg==" + str2);
    String str3 = localMsgService.sendMessage(paramString1, str2, paramContext);
    Logger.i("TXTW", "str==" + str3);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str3);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return str1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      default:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("GamePeriod"))
        str1 = ((XmlPullParser)localObject).nextText();
    }
  }

  public String getWebLimitTime(String paramString1, String paramString2, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    String str1 = "";
    String str2 = new MsgService().sendMessage(paramString1, paramString2, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "RQUrlPeriod</TYPE></HEAD><BODY><UserID>" + paramString1 + "</UserID></BODY></MSG>", paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return str1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      default:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("UrlPeriod"))
        str1 = ((XmlPullParser)localObject).nextText();
    }
  }

  public String getWebTime(String paramString1, String paramString2, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    String str1 = "";
    String str2 = new MsgService().sendMessage(paramString1, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "RQUrlPeriod</TYPE></HEAD><BODY><UserID>" + paramString2 + "</UserID></BODY></MSG>", paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return str1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      default:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("UrlPeriod"))
        str1 = ((XmlPullParser)localObject).nextText();
    }
  }

  public StateBean updateSoftLimitTime(String paramString1, String paramString2, String paramString3, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    StateBean localStateBean = new StateBean();
    MsgService localMsgService = new MsgService();
    String str1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "UDGamePeriod</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID><GamePeriod>" + paramString3 + "</GamePeriod></BODY></MSG>";
    String str2 = localMsgService.sendMessage(paramString1, str1, paramContext);
    Logger.d("xjf", "shiduan-msg--" + str1);
    Logger.d("xjf", "shiduan-str--" + str2);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localStateBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localStateBean = new StateBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localStateBean.setCode(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localStateBean.setDesc(((XmlPullParser)localObject).nextText());
    }
  }

  public StateBean updateWebLimitTime(String paramString1, String paramString2, String paramString3, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    StateBean localStateBean = new StateBean();
    MsgService localMsgService = new MsgService();
    String str1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "UDUrlPeriod</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID><UrlPeriod>" + paramString3 + "</UrlPeriod></BODY></MSG>";
    Logger.i("TXTW", "msg ==" + str1);
    String str2 = localMsgService.sendMessage(paramString1, str1, paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localStateBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localStateBean = new StateBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localStateBean.setCode(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localStateBean.setDesc(((XmlPullParser)localObject).nextText());
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.service.LimitTimeService
 * JD-Core Version:    0.6.2
 */